package com.zzw.design.observer;

import java.util.HashMap;
import java.util.Map;

public class WriterManager {

public Map<String,Writer1> map = new HashMap<String, Writer1>();
	
	public void add(Writer1 writer){
		map.put(writer.getName(), writer);
	}
	
	public Writer1 getWriter(String name){
		return map.get(name);
	}

    private WriterManager(){}
    
    public static WriterManager getInstance(){
        return WriterManagerInstance.instance;
    }
    
    private static class WriterManagerInstance{
        private static WriterManager instance = new WriterManager();
    }
}
